## Computation of the set M(n,q)


from PyM import *


def M(n, q=2):
    M = []
    D = divisors(q**n-1)
    D = D[1:]
    for m in D:
        if gcd(q,m)==1 and order(q,m)==n:
            M += [m]
    return M

M2 = [M(n) for n in range(2,11)]

show(M2)

M3 = [M(n,3) for n in range(2,8)]

show(M3)